package com.ruoyi.web.mapper.incomeexpense;


import com.ruoyi.web.domain.incomeexpense.IncomeExpense;
import com.ruoyi.web.pojo.dto.incomeexpense.IncomeExpenseDetailsVo;
import com.ruoyi.web.pojo.dto.incomeexpense.IncomeExpensePage;
import com.ruoyi.web.pojo.request.incomeexpense.IEPageReq;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 支入支出Mapper接口
 * 
 * @author zq
 * @date 2024-01-09
 */
public interface IncomeExpenseMapper 
{
    /**
     * 查询支入支出
     * 
     * @param id 支入支出主键
     * @return 支入支出
     */
    public IncomeExpense selectIncomeExpenseById(Long id);

    /**
     * 查询支入支出列表
     * 
     * @return 支入支出集合
     */
    public List<IncomeExpense> selectIncomeExpenseList(IEPageReq req);
    public List<IncomeExpensePage> selectIncomeExpenseListVo(IEPageReq req);

    public List<IncomeExpenseDetailsVo> selectDetailsList(IEPageReq req);

    /**
     * 新增支入支出
     * 
     * @param incomeExpense 支入支出
     * @return 结果
     */
    public int insertIncomeExpense(IncomeExpense incomeExpense);

    /**
     * 修改支入支出
     * 
     * @param incomeExpense 支入支出
     * @return 结果
     */
    public int updateIncomeExpense(IncomeExpense incomeExpense);

    /**
     * 删除支入支出
     * 
     * @param id 支入支出主键
     * @return 结果
     */
    public int deleteIncomeExpenseById(Long id);

    /**
     * 批量删除支入支出
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteIncomeExpenseByIds(Long[] ids);

    /**
     *  统计支入支出金额
     * @param list 分类
     * @param userId 用户id
     * @return
     */
    BigDecimal countIncomeExpenseMoney(@Param("list") List<String> list, @Param("userId") Long userId);

    int deleteIncomeExpenseByTypeIds(@Param("array") Long[] ids,@Param("userId") Long userId);

    long count(IEPageReq req);
}
